<template>
  <div class="classcenter">
    <Home_header :settings="config.setting" :showtop="false"></Home_header>
    <div class="bans">
      <div class="ziliao_con">
        <p class="summary">全部资料 一键打包</p>
        <div class="namess">
          <input value="" v-model="namest" id="namese" name="name" type="text" value placeholder="姓名"/>
        </div>
        <div class="mobile">
          <input v-model="phonest" id="mobile" name="mobile" type="text" value placeholder="电话"/>
        </div>
        <div class="namess">
          <input v-model="emitst" id="email" name="email" type="text" value placeholder="邮箱"/>
        </div>
        <div class="code_bao">
          <!-- <div class="code">
            <input type="text" name="code" id="code" placeholder="手机验证码" value />
            <div class="gethuo">
              <span id="getCode">获取验证码</span>
            </div>
          </div> -->
          <div class="ling_c">
            <a @click="onebtn(namest,phonest,emitst,)">一键领取</a>
          </div>
          <div class="checks_txt">
            <input classb="checks" v-model="cheksz" name="checks" type="checkbox" checked="checked"/>
            <span class="fie_span">我已经阅读并同意</span>
            <el-button class="tiao_k" type="text" @click="open">华章教育隐私条款</el-button>
            <span>，且同意接收相关信息推送通知。</span>
          </div>
        </div>
      </div>
    </div>
    <!--    <div class="doahang_con">-->
    <!--      <div class="dao_home">-->
    <!--        <a href="#">-->
    <!--          热门推荐-->
    <!--          <img src="../../assets/img/icon_hots.png" alt />-->
    <!--        </a>-->
    <!--        <a href="#">MBA资料</a>-->
    <!--        <a href="#">EMBA资料</a>-->
    <!--        <a href="#">MPA资料</a>-->
    <!--        <a href="#">MPAcc资料</a>-->
    <!--        <a href="#">MEM资料</a>-->
    <!--      </div>-->
    <!--    </div>-->
    <div class="hot_con">
      <div class="hot_left">
        <div>
          <p class="istitle">热门推荐</p>
        </div>
        <div v-for="(item,index) in data_mba.data" class="rmtj ani">
          <a :href="item.link">
            <img :src="item.image" alt/>
          </a>
        </div>
      </div>
      <!-- <div>{{listCool}}</div> -->
      <div class="hot_right">
        <div class="rg_tops">
          <span>资料下载排行榜</span>
        </div>
        <div class="books">
          <div class="innerscroll">
          <div v-for="(item,index) in listCool.data" class="todownload-p1">
            <div class="numbers">
              {{index+1}}
              <!-- <p>{{item.id}}</p> -->
            </div>
            <span class="span_first">{{item.name}}</span>
            <!-- <span class="span_two">9871次下载</span> -->
            <div class="srtars">
              <img src="../../assets/img/starsss.png" alt/>
            </div>
            <a :href="item.link">立即下载</a>
          </div>
          </div>
        </div>
      </div>
    </div>
    <div class="zl2">
      <p class="istitle">MBA资料</p>
      <div class="zong_mab">
        <div v-for="(item,index) in MBAdata.data" class="img_zong">
          <a :href="item.link">
            <img :src="item.image" alt/>
          </a>
        </div>
      </div>
      <!-- <div>{{EMBAdata}}</div> -->
      <div class="zl_wrap">
        <div class="zl_left">
          <p class="istitle">EMBA资料</p>
          <div class="zi_mb">
            <div v-for="(item,index) in EMBAdata.data" class="rmtj ani">
              <a :href="item.link">
                <img :src="item.image" alt/>
              </a>
            </div>
          </div>
        </div>
        <div class="zl_right">
          <p class="istitle">MEM资料</p>
          <div class="zi_mb">
            <div v-for="(item,index) in MEMdata.data" class="rmtj ani">
              <a :href="item.link">
                <img :src="item.image" alt/>
              </a>
            </div>
          </div>
        </div>
      </div>
      <div class="zl_wrap">
        <div class="zl_left">
          <p class="istitle">MPA资料</p>
          <div class="zi_mb">
            <div v-for="(item,index) in listmpa.data" class="rmtj ani">
              <a :href="item.link">
                <img :src="item.image" alt/>
              </a>
            </div>
          </div>
        </div>
        <div class="zl_right">
          <p class="istitle">MPAcc资料</p>
          <div class="zi_mb">
            <div v-for="(item,index) in listmpacc.data" class="rmtj ani">
              <a :href="item.link">
                <img :src="item.image" alt/>
              </a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
    import Home_header from "../../components/Home-header";

    export default {
        name: "classcenter",
        components: {
            Home_header
        },
        async asyncData({app}) {
            //更多类型
            let config = await app.$apiconfig();
            //console.log("app", app);
            //资料库分类
            let datatypes = await app.$apiGet("datatypes");
            //热门推荐
            let data_mba = await app.$apiGet("data", {type_id: 3, limit: 10000});
            //MBA资料
            let MBAdata = await app.$apiGet("data", {type_id: 4, limit: 10000});
            //EMBA资料
            let EMBAdata = await app.$apiGet("data", {type_id: 5, limit: 10000});
            //MEM资料
            let MEMdata = await app.$apiGet("data", {type_id: 6, limit: 10000});
            //资料库列表
            let listCool = await app.$apiGet("data", {type_id: 0, limit: 10000});
            let listmpa = await app.$apiGet("data", {type_id: 7, limit: 10000});
            let listmpacc = await app.$apiGet("data", {type_id: 2, limit: 10000});
            // let boxsiz = datatypes.data;
            // let basecontent = data_mba.data;
            // console.log(datatypes);
            // console.log(data_mba);
            return {
                listmpa,
                listmpacc,
                cheksz: '',
                namest: '',
                phonest: '',
                emitst: '',
                listCool: listCool,
                MEMdata: MEMdata,
                EMBAdata: EMBAdata,
                MBAdata: MBAdata,
                config: config,
                datatypes: datatypes,
                data_mba: data_mba
                // boxsiz: boxsiz,
                // basecontent: basecontent
            };
        },
        head() {
            return this.config.header;
        },
        created() {
            console.log(this.listCool)
            // console.log(this.data_mba);
        },
        methods: {
            open() {
                this.$alert('<p>我们收集哪类个人信息？ </p><p>通常，您能在匿名的状态下访问我们的网站并获取信息。在我们请求您提供有关信息之前，我们会解释这些信息的用途我们有些站点需要注册才能加入。在通常情况下，这类注册只要求您提供一个电子邮件地址和姓名、手机等的基本信息。有时我们也会请您提供更多的信息。我们这样做是为了使我们更好的理解您的需求，以便向您提供有效的服务。我们站点收集的信息包括姓名，地址和电话号码。您有权随时决定不接受来自我们的任何资料。 </p> <p>尊重并保护您的隐私</p><p>我们将采取适当的步骤保护您的隐私。每当您提供给我们个人隐私信息时，我们将采取合理的步骤保护您的个人信息，我们也将采取合理的安全手段保护已存储的个人信息。除非根据法律或政府的强制性规定，在未得到您的许可之前，我们不会把您的任何个人信息提供给无关的第三方。</p>', '隐私条款', {
                    dangerouslyUseHTMLString: true
                });
            },
            onebtn(name, phone, eml, cheksz) {
                if (!name) {
                    this.$message.error('请输入姓名');
                    return false;
                }
                if (!/^1[3456789]\d{9}$/.test(phone)) {
                    this.$message.error("请输入正确的手机号码");
                    return false;
                }
                if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(eml)) {
                    this.$message.error("请输入正确的邮箱");
                    return false;
                }
                console.log(this.cheksz)
                if (this.cheksz == false) {
                    this.$message.error('请勾选条款');
                    return false;
                }
                this.$apiPost("addsignlog", {
                    name: name,
                    phone: phone,
                    email: eml
                }).then(res => {
                    console.log(res);
                    if (res.code == 1) {
                        this.$message.success("提交成功");
                        this.namest = ""
                        this.phonest = ""
                        this.emitst = ""
                    } else {
                        this.$message.error(res.msg);
                    }
                });
            }
        }
    };
</script>

<style scoped>
  .numbers::after {
    content: "";
    width: 0px;
    height: 0px;
    position: absolute;
    bottom: 0px;
    left: 0px;
    /* background: #fff; */
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 8px solid #fff;
  }

  .numbers {
    position: relative;
    width: 18px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ccc;
    color: #fff;
    /* border-radius: 50%; */
    margin-right: 10px;
  }

  .books .todownload-p1:nth-child(1) .numbers {
    background: red;
  }

  .books .todownload-p1:nth-child(2) .numbers {
    background: rgb(230, 178, 8);
  }

  .books .todownload-p1:nth-child(3) .numbers {
    background: rgb(231, 247, 12);
  }

  .zi_mb .ani {
    margin-right: 60px;
  }

  .zi_mb .ani:nth-child(2n + 2) {
    margin-right: 0px;
  }

  .zl_right {
    width: 682px;
  }

  .zl_left:nth-child(2n + 2) {
    margin-right: 0px;
  }

  .zl_left {
    width: 682px;
    display: inline-block;
    margin-bottom: 50px;
  }

  .zl_wrap {
    width: 1433px;
    height: auto;
    margin: auto;
    display: flex;
    justify-content: space-between;
  }

  .img_zong a {
    width: 309px;
    display: inline-block;
    height: 410px;
  }

  .img_zong img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
  }

  .img_zong img:hover {
    transform: scale(1.1);
    transition: transform 0.5s;
  }

  .img_zong {
    width: auto;
    margin-right: 60px;
    display: inline-block;
    margin-top: 35px;
  }

  .zong_mab .img_zong:nth-child(4n + 4) {
    margin-right: 0px;
  }

  .zl2 {
    width: 1433px;
    margin: auto;
  }

  .todownload-p1 a {
    display: block;
    width: 80px;
    height: 27px;
    border-radius: 4px;
    background: #d71209;
    text-align: center;
    line-height: 27px;
    color: #ffffff;
    font-size: 12px;
    margin-left: 26px;
  }

  .srtars {
    display: flex;
    align-items: center;
    margin-left: 10px;
  }

  .span_two {
    display: block;
    float: left;
    font-size: 18px;
    color: #949494;
    width: 130px;
    text-align: right;
  }

  .span_first {
    padding-left: 10px;
    width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 18px;
    color: #000000;
  }

  .todownload-p1 {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    justify-content: space-around;
  }

  .books {
    width: 100%;
    height: 414px;
    box-shadow: 0 0 20px #a3a3a3;
    margin-top: 14px;
    padding: 20px;
    background-color: #ffffff;
    box-sizing: border-box;
    overflow: hidden;
  }
.books .innerscroll{
  padding: 15px ;
  overflow-y: auto;
  height: calc(100% - 40px);
}
  .rg_tops a {
    font-size: 15px;
    color: #a8a8a8;
  }

  .rg_tops span {
    color: #9d0015;
    font-size: 25px;
    font-weight: 500;
  }

  .rg_tops {
    width: 100%;
    height: 79px;
    background: #fff;
    box-shadow: 0 0 20px #a3a3a3;
    padding-left: 53px;
    padding-right: 60px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .rmtj img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;

  }

  .rmtj img:hover {
    transform: scale(1.1);
    transition: transform 0.5s;
  }

  .rmtj {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    width: 309px;
    height: 410px;
    display: inline-block;
  }

  .istitle {
    display: block;
    width: 100%;
    height: 79px;
    background: url(../../assets/img/red_btm_bgs.png) left bottom no-repeat;
    background-color: #ffffff;
    color: #9d0015;
    font-size: 24px;
    line-height: 79px;
    font-weight: bold;
    padding-left: 50px;
    box-sizing: border-box;
  }

  .hot_left {
    width: 682px;
  }

  .hot_left .rmtj:last-child {
    margin-right: 0px;
  }

  .hot_left .rmtj {
    margin-right: 60px;
  }

  .hot_right {
    width: 682px;
    margin-left: 68px;
  }

  .hot_con {
    padding-top: 38px;
    width: 1433px;
    height: auto;
    display: flex;
    margin: auto;
  }

  .dao_home a img {
    position: absolute;
    right: 43px;
    top: 25px;
  }

  .dao_home a {
    position: relative;
  }

  .dao_home a:hover {
    background: #9d0015;
  }

  .dao_home a {
    color: #fff;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 238px;
    height: 100%;
  }

  .dao_home {
    display: flex;
    align-items: center;
    width: 1433px;
    height: 82px;
    margin: auto;
  }

  .doahang_con {
    width: 100%;
    height: 82px;
    background-color: #373737;
    margin-top: -3px;
  }

  .fie_span {
    margin-right: 5px;
    display: inline-block;
  }

  .checks_txt a:hover {
    text-decoration: underline;
  }

  .checks_txt a {
    color: #9d0015;
  }

  .checks {
    margin-right: 5px;
  }

  .checks_txt {
    width: 400px;
    font-weight: 500;
    font-size: 12px;
    align-items: center;
  }

  .ling_c a {
    display: block;
    text-decoration: none;
    color: white;
    font-size: 18px;
  }

  .ling_c {
    margin-top: 25px;
    width: 377px;
    box-sizing: border-box;
    height: 57px;
    margin-bottom: 26px;
    background: #9d0015;
    text-align: center;
    font-size: 23px;
    color: white;
    line-height: 58px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    overflow: hidden;
  }

  .code {
    display: flex;
    align-items: flex-end;
  }

  .gethuo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 57px;
    margin-left: 10px;
  }

  .code_bao {
    width: 376px;
    height: 57px;
    margin: auto;
  }

  .namess {
    width: 376px;
    height: 57px;
    margin: auto;
    background-color: #eeeeee;
    border-radius: 8px;
    margin-top: 25px;
    background-image: url(../../assets/img/names.png);
    background-position: 14px 16px;
    background-size: 25px;
    background-repeat: no-repeat;
  }

  #code {
    width: 290px;
    padding-left: 56px;
    box-sizing: border-box;
    height: 57px;
    margin: initial;
    background-color: #eeeeee;
    border-radius: 8px;
    margin-top: 25px;
    background-image: url(../../assets/img/mails.png);
    background-position: 14px 16px;
    background-size: 25px;
    border: 0px;
    font-size: 16px;
    background-repeat: no-repeat;
  }

  .email {
    width: 376px;
    height: 57px;
    margin: auto;
    background-color: #eeeeee;
    border-radius: 8px;
    margin-top: 25px;
    background-image: url(../../assets/img/mails.png);
    background-position: 14px 16px;
    background-size: 25px;
    background-repeat: no-repeat;
  }

  .mobile {
    width: 376px;
    height: 57px;
    margin: auto;
    background-color: #eeeeee;
    border-radius: 8px;
    margin-top: 25px;
    background-image: url(../../assets/img/phones.png);
    background-position: 14px 16px;
    background-size: 25px;
    background-repeat: no-repeat;
  }

  #namese {
    outline: none;
    border-color: transparent;
    background-color: transparent;
    font-size: 20px;
    padding: 0;
    padding-left: 10px;
    height: 100%;
    box-sizing: border-box;
    color: rgb(51, 51, 51);
    border: none;
    display: block;
    float: left;
    width: 330px;
    font-size: 16px;
    padding-left: 50px;
  }

  #email {
    outline: none;
    border-color: transparent;
    background-color: transparent;
    font-size: 20px;
    padding: 0;
    padding-left: 10px;
    height: 100%;
    box-sizing: border-box;
    color: rgb(51, 51, 51);
    border: none;
    display: block;
    float: left;
    width: 330px;
    font-size: 16px;
    padding-left: 50px;
  }

  #mobile {
    outline: none;
    border-color: transparent;
    background-color: transparent;
    font-size: 20px;
    padding: 0;
    padding-left: 10px;
    height: 100%;
    box-sizing: border-box;
    color: rgb(51, 51, 51);
    border: none;
    display: block;
    float: left;
    width: 330px;
    font-size: 16px;
    padding-left: 50px;
  }

  .summary {
    width: 376px;
    color: #000;
    font-size: 26px;
    margin-top: 38px;
    margin-left: 48px;
    margin-right: 46px;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 29px;
  }

  .ziliao_con {
    position: absolute;
    top: 80px;
    right: 100px;
    width: 475px;
    padding-bottom: 20px;
    min-height: 700px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid transparent;
    box-shadow: 0px 0px 30px #b5bdbc;
    box-sizing: border-box;
  }

  .bans {
    position: relative;
    width: 100%;
    background: url(../../assets/img/banner_backimgss.png) no-repeat;
    height: 56.8vw;
    background-size: contain;
  }

  .img_top {
    display: flex;
    align-items: center;
    margin-right: 12px;
  }

  .neixiang span {
    font-size: 24px;
    color: #fff;
  }

  .neixiang i {
    width: 100%;
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: #eee;
  }

  .neixiang {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .home_right {
    display: flex;
  }

  .homes {
    width: 1433px;
    margin: auto;
    display: flex;
    height: 100%;
    justify-content: space-between;
    align-items: center;
  }

  * {
    padding: 0px;
    margin: 0px;
  }

  .headers {
    width: 100%;
    height: 67px;
    background: rgba(161, 161, 161, 0.7);
  }

  body {
    background: #eceff1;
  }

  .tiao_k {
    font-size: 12px;
    color: red;
  }

  @media (max-width: 1500px) {
    .hot_con {
      width: 90%;
    }

    .hot_left {
      width: 45%;
    }

    .hot_right {
      width: 50%;
      margin-left: 5%;
    }

    .rmtj {
      width: 45%;
    }

    .hot_left .rmtj {
      margin-right: 5%;
    }

    .zl2 {
      width: 90%;
    }

    .img_zong {
      width: calc((100% - 180px) / 4);
    }

    .img_zong a {
      width: 100%;
    }

    .zl_wrap {
      width: 100%;
    }

    .zl_left {
      width: 50%;
    }

    .zl_right {
      width: 50%;
    }

    .zi_mb .ani {
      margin-right: 5%;
    }

    .ziliao_con {
      position: inherit;
      top: 80px;
      right: 0px;
      margin-left: -200px;
      left: 50%;
      width: 400px;
      padding-bottom: 20px;
      min-height: 500px;
      background-color: white;
      border-radius: 4px;
      border: 1px solid transparent;
      box-shadow: 0px 0px 30px #b5bdbc;
      box-sizing: border-box;
    }

    .bans {
      background-size: cover;
    }

    .namess {
      width: 80%;
    }

    .mobile {
      width: 80%;
    }

    .code_bao {
      width: 80%;
    }

    #code {
      width: 80%;
    }

    .ling_c {
      width: 100%;
    }

    .checks_txt {
      width: 100%;
    }

    .summary {
      width: 100%;
      text-align: center;
      margin-right: 0px;
      margin-left: 0px;
    }

    .ziliao_con {
      min-height: auto;
      height: 70%;
      left:77%;
    }
  }

  @media (max-width: 1250px) {
    .ziliao_con {
      min-height: auto;
      height: 70%;
      left:50%;
    }
    .summary {
      font-size: 20px;
      margin-top: 8px;
      padding-bottom: 8px;
    }
  }

  @media (max-width: 1100px) {
    .hot_con {
      flex-direction: column;
    }

    .hot_left {
      width: 100%;
    }

    .hot_right {
      width: 100%;
      margin-left: 0%;
      margin-top: 40px;
    }

    .todownload-p1 {
      justify-content: space-between;
    }

    .ziliao_con {
      height: 90%;
      top: 5%;
    }

    .namess {
      margin-top: 10px;
    }

    .mobile {
      margin-top: 10px;
    }

    .ling_c {
      margin-top: 25px;
      width: 100%;
      box-sizing: border-box;
      height: auto;
      margin-bottom: 10px;
      background: #9d0015;
      text-align: center;
      font-size: 19px;
      color: white;
      line-height: inherit;
      border-radius: 8px;
      cursor: pointer;
      display: block;
      overflow: hidden;
    }

    #email {
      width: 100%;
    }

    #mobile {
      width: 100%;
    }

    #namese {
      width: 100%;
    }
  }

  @media (max-width: 750px) {
    .zl_left{
      margin: auto!important;
    }
    .ling_c{
      width: 60%;
      box-sizing: border-box;
      height: auto;
      background: #9d0015;
      text-align: center;
      font-size: 19px;
      color: white;
      line-height: inherit;
      border-radius: 8px;
      cursor: pointer;
      display: block;
      overflow: hidden;
      padding: 5px;
      margin: 15px auto;
    }
    .namess,.mobile{
      height: 40px;
      background-position: 14px 11px;
    }
    .srtars{
      display: none;
    }

    .img_zong a {
      display: block;
       height: auto;
    }
    .rmtj{
      height:auto!important;
    }
    .img_zong {
      width: calc((100% - 30px) / 4);
    }

    .img_zong {
      margin-right: 10px;
    }

    .img_zong[data-v-4c006d72] {
      width: calc((100% - 30px) / 2);
    }

    .zl_wrap {
      flex-direction: column;
    }

    .zl_left, .zl_right {
      width: 100%;
    }

    .ziliao_con {
      height: 350px;
    }

    .bans {
      height: 450px;
    }

    .books {
      padding: 15px 20px 20px 15px;
    }

    .numbers {
      width: 30px;
    }
    .rmtj {
      margin-top:35px
    }
  }
</style>
